import Vue from 'vue';
import App from './App';
import store from '@/store';
// 混入
import goPage from '@/mixin/goPage.js';
import uView from "@/uview-ui";
Vue.use(uView);
// 公共处理函数
import * as utils from './common/utils.js';
// 新增按钮，全部组件
import addBtn from './components/AddData.vue'
// 空白页面，全局组件
import empty from '@/components/empty/index.vue'
// 手机顶部状态栏，全局组件
import uniStatusBar from '@/components/uni-status-bar.vue';
// 数字精度计算
import NP from "number-precision";

// 权限
import { checkActionAccess } from "@/common/check";
import * as nodes from "@/common/node";
import Tabbar from '@/components/Tabbar/index';
Vue.component('Tabbar', Tabbar)

Vue.prototype.$accessCheck = checkActionAccess;
Vue.prototype.$Access = nodes;

Vue.prototype.$utils = utils;
Vue.prototype.$store = store;
Vue.prototype.$NP = NP; // 高精度数学计算
Vue.mixin(goPage)
Vue.component('addBtn', addBtn)
Vue.component('Aempty', empty)
Vue.component('uniStatusBar', uniStatusBar)

/* 获取上页的数据 */
Vue.prototype._prePage = () => {
	let pages = getCurrentPages();
	let prePage = pages[pages.length - 2];
	// #ifdef H5 
	return prePage;
	// #endif
	return prePage.$vm;
}

Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
	...App
})
// http拦截器，将此部分放在new Vue()和app.$mount()之间，才能App.vue中正常使用
import httpInterceptor from '@/common/http.interceptor.js'
Vue.use(httpInterceptor, app)

// http接口API集中管理引入部分
import httpApi from '@/common/http.api.js'
Vue.use(httpApi, app)
app.$mount()
